home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
TASEXAM6.ARJ
/
DIFNDX.TAS
< prev
next >
Wrap
Text File
|
1991-11-28
|
4KB
|
86 lines
{ DIFFNDX.TAS, Version 1.1
*
Script to create graphs based on the "Diffusion Index". It is
calculated by taking a ratio of the number of stocks with closing
prices that are up over 9 months versus all stocks in the
population. Diffusion index signals:
> 90% or more -- Early selling warning, do no more buying and
start to weed out stocks to build cash.
> Decline from over 90% to 50% -- Immediate final sell signal
from a market top. Liquidate all holdings immediately.
> Under 10% -- Too late to sell; major panic bottom forming.
*
All stocks in ticker list should have at least the number of
quotes specified in the #MAX_QUOTES statement, or they will be
ignored in all calculations of the Diffusion Index. I generally
use my DJ30 (Dow Jones Industrials) ticker list with the script.
*
Use the "@" command parameters to change default settings of the
variables used in this program. For example:
TAS pgmname tickerlist @variable=xxx
*
Note the statement "#INCLUDE SCANDATE.SUB". In order to run this
program, a file named SCANDATE.SUB must exist. The default file
just contains a comment ("Subroutine for possible #SCAN_DATE").
This default does NOT affect the running of the program. But, it
will allow you to run the program from a BATch file several times
using different #SCANDATE parameters. For example:
REM ********************************************************
REM * pgmname.BAT
REM * Run pgmname.TAS for different days
REM ********************************************************
copy scandate.sub scandate.bak
erase pgmname.lst
echo #SCAN_DATE 910923 >scandate.sub
tas pgmname tickerlist @variable=xxx
echo #SCAN_DATE 910930 >scandate.sub
tas pgmname tickerlist @variable=xxx
REM ********************************************************
REM * Reset the SCANDATE.SUB file so it won't do anything
REM ********************************************************
copy scandate.bak scandate.sub
erase scandate.bak
*
Created 11/25/91 by Martin Moore (on request by Mitchell Herman)
Changed 11/28/91 (1.1) / Format changes by Randy Harmelink
/ Add documentation and INDEX graph
}
#INCLUDE SCANDATE.SUB { Possible #SCAN_DATE parameter }
#MAX_QUOTES 500
#INDEX 'sp-500'
{**************************************************************}
{ Create defaults for parameters of technical studies }
{ ------------------------------------------------------------ }
{ "LookBack" indicates the number of days to use for looking }
{ back for computation of the Diffusion Index. }
{ The default is 9 months (i.e. 9 * 22). }
{**************************************************************}
if QuotesUse = 0 then QuotesUse := Quote_Count;
if LookBack = 0 then LookBack := 9 * 22;
{**************************************************************}
{ Define arrays used in program }
{**************************************************************}
DiffUp : Array; { Up issues }
DiffTot : Array; { Total issues }
{**************************************************************}
{ Examine individual stocks to see if they are up over period }
{**************************************************************}
if Quote_Count >= QuotesUse then
for i = LookBack + 1; i <= Quote_Count ; i = i + 1;
if Close[i] > Close[i-LookBack] then begin
DiffUp[i] := DiffUp[i] + 1;
DiffTot[i] := DiffTot[i] + 1;
end;
else
DiffTot[i] := DiffTot[i] + 1;
{**************************************************************}
{ Display results when all stocks have been examined }
{**************************************************************}
if Last_Ticker then begin
DiffUp := MulBy(Div(DiffUp,DiffTot),100);
opengraph(2,-QuotesUse+LookBack,0);
graph(DiffUp,'Diffusion Index: '+format(diffUp[0],'%5.2f%%'));
graph(Index,'DJIA closing prices');
CloseGraph();
end;